const main = "http://127.0.0.1:3000";

// 获取头部分类
export const topBar = () => `${main}/topBar`;
// 发送验证码
export const getCode = () => `${main}/login/email`;
// 登录
export const signIn = (account: string, password: string, type: string) => `${main}/login/signIn?account=${account}&password=${password}&type=${type}`;
// 注册 post
export const register = () => `${main}/login/register`;
// 获取个人信息 （邮箱）
export const getUserMsg = (account: String) => `${main}/userData?account=${account}&type=u`;
// 获取个人信息（id）
export const getUserIdMsg = (id: String,type:any) => `${main}/userIdData?id=${id}&type=${type}`;
// 图片前部分
export const getImg = (img: any) => `${main}/imgs/${img}`;
// 图片储存
export const uploadsApi = () => `${main}/uploads`;
// 文章上传
export const upEssay = () => `${main}/essay/add`;
// 获取文章（所有）
export const getEssayAll = (type: any) => `${main}/essay/all?end=user&type=${type}`;
// 获取文章（分类）
export const getEssayClassify = (stype: any) => `${main}/essay/classify?stype=${stype}`;
// 获取文章详细
export const getEssayDetailed = (id: any) => `${main}/essay/detailed?id=${id}`;
// 更改头像
export const setPic = () => `${main}/setPic`;
// 添加浏览数据
export const setViewAdd = () => `${main}/essay/viewAdd`;
// 修改用户数据
export const setUserData = () => `${main}/setUserData`;
// 更改邮箱
export const setEmail = () => `${main}/login/setEmail`;
//更改密码
export const setPassWord = () => `${main}/login/setPassWord`;
// 添加喜欢/收藏addEssay
export const setAddEssay = () => `${main}/addEssay`;
// 取消喜欢收藏
export const setCancelEssay = () => `${main}/cancel`;
// 喜欢收藏数量操作
export const setLC = () => `${main}/essay/setLC`;
// （模糊）查询
export const searchEssay = (value: any) => `${main}/essay/search?value=${value}`;
